package com.ruoyi.common.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 文件状态
 */
public enum CollectFileStatusEnum {

    //异常
    FILE_ERROR (0,"异常"),
    FILE_WAIT (1,"待解析"),
    FILE_SUCC (2,"完成");

    private Integer code;

    private String name;

    public Integer getCode() {
        return code;
    }

    public String getName() {
        return name;
    }

    private CollectFileStatusEnum(Integer code, String name) {
        this.code = code;
        this.name = name;
    }

    private static Map<Integer,String> enumMap = new HashMap<>();
    static {
        enumMap.put(FILE_ERROR.getCode(),FILE_ERROR.getName());
        enumMap.put(FILE_WAIT.getCode(),FILE_WAIT.getName());
        enumMap.put(FILE_SUCC.getCode(),FILE_SUCC.getName());
    }

    public static   String  statusName(Integer code) {
        return enumMap.get(code);
    }
}
